local ServerOHOH = _G.ServerOHOH;
local DataBaseManager = ServerOHOH.load.DataBaseManager();
local ServerAudioManager = ServerOHOH.load.Server_AudioManager();
local M = ServerOHOH.class.new(script, ServerOHOH.files.ServerBase());
local CommonOHOH =_G.CommonOHOH
local ConnectClass=CommonOHOH.load.Connect();


function M.new()
	local self = M();
	_G.server = self;
	return self;
end;

function M.ctor(self)
	M.super.ctor(self);
	self:SetAutoCreateCharacter(false);
end;

function M.dtor(self)
	M.super.dtor(self);
end;

local ColliderGroup = ServerOHOH.load.ColliderGroup();
local ColliderManager = ServerOHOH.load.ColliderManager();

function M.OnPlayerIn(self, player)
end;


function M.OnPlayerOut(self, player)
end;



--开启服务器逻辑，先于服务器玩家创建
function M.OnStart(self)
	self:InitColliderGroup();
	_G.POOL=self:AddComponent(_G.CommonOHOH.load.PoolComponent());

	--支付中心
	self:AddComponent(ServerOHOH.load.Server_MallComponent());

	--排行榜刷新
	self:AddComponent(ServerOHOH.load.Server_RankComponent());

	--宠物交易
	self:AddComponent(ServerOHOH.load.Server_TradeComponent());


	self:AddComponent(_G.CommonOHOH.load.ReayBattleCtrl()); 
	self:AddComponent(_G.CommonOHOH.load.Common_ChristmasCtrl()); 

end;

function M.InitColliderGroup(self)
	ColliderGroup.character = true;
	ColliderGroup.monster = true;
	ColliderGroup.NoCollider = true;

	ColliderManager:SetGroupCollidable(ColliderGroup.character, ColliderGroup.character, false);
	ColliderManager:SetGroupCollidable(ColliderGroup.monster, ColliderGroup.monster, false);
	ColliderManager:SetGroupCollidable(ColliderGroup.monster, ColliderGroup.character, false);
	ColliderManager:SetGroupCollidable(ColliderGroup.NoCollider, ColliderGroup.NoCollider, false);
	ColliderManager:SetGroupCollidable(ColliderGroup.NoCollider, ColliderGroup.character, false);
	ColliderManager:SetGroupCollidable(ColliderGroup.NoCollider, ColliderGroup.monster, false);
	ColliderManager:SetGroupCollidable(ColliderGroup.NoCollider, ColliderGroup.Default, false);

end;

return M;
